package com.fitso.model.bean;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;

public class Credentials implements Serializable {
	// Only change on breaking changes, i.e., removing fields
	private static final long serialVersionUID = 1;

	private String _email, _password;
	
	public Credentials(){}
	
	public Credentials(String email, String password){
		_email = email;
		_password = password;
	}

	public String getEmail() {
		return _email;
	}

	public void setEmail(String email) {
		_email = email;
	}

	public String getPassword() {
		return _password;
	}

	public void setPassword(String password) {
		_password = password;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null) {
			return false;
		}
		if (o == this) {
			return true;
		}
		if (o.getClass() != getClass()) {
			return false;
		}

		Credentials other = (Credentials) o;
		return new EqualsBuilder().append(_email, other._email).append(_password, other._password).isEquals();

	}
	
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(_email).append(_password).toHashCode();
	}

	@Override
	public String toString() {
		return new ReflectionToStringBuilder(this).toString();
	}
}
